<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript">
        function change() {
            var pid=jQuery("#first option:selected").val();
            jQuery(" #second").remove();
            $.getJSON("/goodsUpload/classification","pid="+pid,callback)
            function callback(data) {
                jQuery("#pp").append("<select id=\"second\" name='classificationid' ></select>")
                for (var a=0;a<data.length;a++){
                    var id=data[a].classificationid;
                    var name=data[a].descriptionofspecies;
                    jQuery("#second").append("<option name='classificationid' class=\"select2\"value="+id+">"+name+"<option>")
                }
            }
        }



    </script>
</head>
<body>
<form action="/goodsUpload/modifyGoodsMessage"  method="get" >
    <p><input type="hidden" th:value="${first.getGoodsid()}" name="goodsid"></p>
    <p>商品名称：<input type="text" name="tradename" th:value="${first.getTradename()}"></p>
    <p>价格 &nbsp &nbsp &nbsp &nbsp ：<input type="text" name="price" th:value="${first.getPrice()}"></p>
    <p>折扣 &nbsp &nbsp &nbsp &nbsp ：<input type="text" name="membershipdiscount" th:value="${first.getMembershipdiscount()}"></p>
    <p>商品说明：<input type="text" name="commoditydescription" th:value="${first.getCommoditydescription()}"></p>
    <p>商品亮点：<input type="text" name="commodityhighlights" th:value="${first.getCommodityhighlights()}"></p>
    <p>商品规格：<input type="text" name="specifications" th:value="${first.getSpecifications()}"></p>
    <p>商品保质期：<input type="text" name="qualityguaranteeperiod"  th:value="${first.getQualityguaranteeperiod()}"></p>
    <p>储存方式：<input type="text" name="storagemode"  th:value="${first.getStoragemode()}"></p>
    <p>包装 &nbsp &nbsp &nbsp &nbsp：<input type="text" name="baozhuang" th:value="${first.getBaozhuang()}"></p>
    <p>商品一级分类：<select id="first" onchange="change()">
        <option th:each="list : ${firstClassfiy}" th:text="${list.getDescriptionofspecies()}" th:value="${list.getClassificationid()}"></option>
    </select></p>
    <p id="pp">商品二级分类:<select id="second" name="classificationid">
        <option class="select2"  th:each="list1 : ${secondClassfiy}" th:text="${list1.getDescriptionofspecies()}" th:value="${list1.getClassificationid()}"></option>
    </select></p>
    <p><input type="submit" ></p>
</form>
</body>
</html>